package com.schoolgard.entitybean;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * ParamServerToDevice entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "PARAM_SERVER_TO_DEVICE")
@SequenceGenerator (name="AUTO_ID", sequenceName="AUTO_ID")
public class ParamServerToDevice implements java.io.Serializable {

	// Fields

	private Long id;
	private JobMode jobMode;
	private JobStatus jobStatus;
	private Date createDatetime;
	private Long userId;
	private String userName;
	private String router;
	private String guid;
	private Date finishDatetime;
	private Date startTime;
	private String deviceName;

	// Constructors

	/** default constructor */
	public ParamServerToDevice() {
	}

	/** minimal constructor */
	public ParamServerToDevice(Long id, JobMode jobMode, JobStatus jobStatus,
			String guid) {
		this.id = id;
		this.jobMode = jobMode;
		this.jobStatus = jobStatus;
		this.guid = guid;
	}

	/** full constructor */
	public ParamServerToDevice(Long id, JobMode jobMode, JobStatus jobStatus,
			Date createDatetime, Long userId, String userName, String router,
			String guid, Date finishDatetime) {
		this.id = id;
		this.jobMode = jobMode;
		this.jobStatus = jobStatus;
		this.createDatetime = createDatetime;
		this.userId = userId;
		this.userName = userName;
		this.router = router;
		this.guid = guid;
		this.finishDatetime = finishDatetime;
	}

	// Property accessors
	@Id
	@Column(name = "ID", unique = true, nullable = false, precision = 10, scale = 0)
	@GeneratedValue (strategy=GenerationType.SEQUENCE, generator="AUTO_ID")
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "JOB_MODE_ID", nullable = false)
	public JobMode getJobMode() {
		return this.jobMode;
	}

	public void setJobMode(JobMode jobMode) {
		this.jobMode = jobMode;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "JOB_STATUS_ID", nullable = false)
	public JobStatus getJobStatus() {
		return this.jobStatus;
	}

	public void setJobStatus(JobStatus jobStatus) {
		this.jobStatus = jobStatus;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_DATETIME")
	public Date getCreateDatetime() {
		return this.createDatetime;
	}

	public void setCreateDatetime(Date createDatetime) {
		this.createDatetime = createDatetime;
	}

	@Column(name = "USER_ID", precision = 10, scale = 0)
	public Long getUserId() {
		return this.userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	@Column(name = "USER_NAME", length = 64)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "ROUTER", length = 1024)
	public String getRouter() {
		return this.router;
	}

	public void setRouter(String router) {
		this.router = router;
	}

	@Column(name = "GUID", nullable = false, length = 64)
	public String getGuid() {
		return this.guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FINISH_DATETIME")
	public Date getFinishDatetime() {
		return this.finishDatetime;
	}

	public void setFinishDatetime(Date finishDatetime) {
		this.finishDatetime = finishDatetime;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "START_TIME")
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Column(name = "device_name")
	public String getDeviceName() {
		return deviceName;
	}

	public void setDeviceName(String deviceName) {
		this.deviceName = deviceName;
	}
}